package com.yld.car.application;

import java.nio.MappedByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import android.app.Activity;
import android.app.Application;
import android.graphics.Bitmap;
import cn.jpush.android.api.JPushInterface;
import cn.yld.car.db.RecentlyViewedDBHelper;

import com.yld.car.domain.BaseColorInfo;
import com.yld.car.domain.Car;
import com.yld.car.domain.DealerBaseInfo;
import com.yld.car.domain.EditCarInfo;
import com.yld.car.domain.SearchDetailCar;

public class MyApplication extends Application {

	// 爱车行
	// AppID：wxec55a6cde46368bd
	// AppSecret：182ed6da9eec635f603a826ec1336c25
	private boolean isFinishLogin;

	public boolean isFinishLogin() {
		return isFinishLogin;
	}

	public void setFinishLogin(boolean isFinishLogin) {
		this.isFinishLogin = isFinishLogin;
	}

	private ArrayList<Bitmap> allBitmaps = new ArrayList<Bitmap>();

	private ArrayList<String> allImageUrls = new ArrayList<String>();

	public ArrayList<String> getAllImageUrls() {
		return allImageUrls;
	}

	public void setAllImageUrls(ArrayList<String> allImageUrls) {
		this.allImageUrls = allImageUrls;
	}

	public ArrayList<Bitmap> getAllBitmaps() {
		return allBitmaps;
	}

	public void setAllBitmaps(ArrayList<Bitmap> allBitmaps) {
		this.allBitmaps = allBitmaps;
	}

	private ArrayList<Activity> historyStacks = new ArrayList<Activity>();

	public void setHistoryStack(Activity a) {
		this.historyStacks.add(a);
	}

	/**
	 * 退出应用
	 */
	public void exitApp() {

		for (Activity a : historyStacks) {

			a.finish();
		}

	}

	// 定义变量用于获取车源型号

	private Car mCar;

	// 存放车相关的配置信息
	private HashMap<String, ArrayList<BaseColorInfo>> allConfigurations = new HashMap<String, ArrayList<BaseColorInfo>>();

	public HashMap<String, ArrayList<BaseColorInfo>> getAllConfigurations() {
		return allConfigurations;
	}

	private long[] configurationOneIds;

	public long[] getConfigurationOneIds() {
		return configurationOneIds;
	}

	public void setConfigurationOneIds(long[] configurationOneIds) {
		this.configurationOneIds = configurationOneIds;
	}

	public long[] getConfigurationTwoIds() {
		return configurationTwoIds;
	}

	public void setConfigurationTwoIds(long[] configurationTwoIds) {
		this.configurationTwoIds = configurationTwoIds;
	}

	private long[] configurationTwoIds;

	private long[] configurationThreeIds;

	public long[] getConfigurationThreeIds() {
		return configurationThreeIds;
	}

	public void setConfigurationThreeIds(long[] configurationThreeIds) {
		this.configurationThreeIds = configurationThreeIds;
	}

	public long[] getConfigurationFourIds() {
		return configurationFourIds;
	}

	public void setConfigurationFourIds(long[] configurationFourIds) {
		this.configurationFourIds = configurationFourIds;
	}

	private long[] configurationFourIds;

	// public void setAllConfigurations(
	// HashMap<String, ArrayList<String>> allConfigurations) {
	// this.allConfigurations = allConfigurations;
	// }

	public void setCar(Car c) {

		this.mCar = c;

	}

	private Car mSeriesCar;

	public Car getmSeriesCar() {
		return mSeriesCar;
	}

	public void setmSeriesCar(Car mSeriesCar) {
		this.mSeriesCar = mSeriesCar;
	}

	public Car getCar() {

		return this.mCar;
	}

	public HashMap<String, String> getmEnteriorColor() {
		return mEnteriorColor;
	}

	public void setmEnteriorColor(HashMap<String, String> mEnteriorColor) {
		this.mEnteriorColor = mEnteriorColor;
	}

	public HashMap<String, String> getmInnerColor() {
		return mInnerColor;
	}

	public void setmInnerColor(HashMap<String, String> mInnerColor) {
		this.mInnerColor = mInnerColor;
	}

	public HashMap<String, String> getmWoodColor() {
		return mWoodColor;
	}

	public void setmWoodColor(HashMap<String, String> mWoodColor) {
		this.mWoodColor = mWoodColor;
	}

	private HashMap<String, String> mEnteriorColor = new HashMap<String, String>();
	private HashMap<String, String> mInnerColor = new HashMap<String, String>();
	private HashMap<String, String> mWoodColor = new HashMap<String, String>();
	private HashMap<String, String> mWheelHubName = new HashMap<String, String>();

	public HashMap<String, String> getmWheelHubName() {
		return mWheelHubName;
	}

	public void setmWheelHubName(HashMap<String, String> mWheelHubName) {
		this.mWheelHubName = mWheelHubName;
	}

	public String getmDisplacementName() {
		return this.mDisplacement;
	}

	public void setmDisplacementName(String name) {
		this.mDisplacement = name;
	}

	private String mDisplacement;
	/**
	 * ，选择要发布的车源的型号、系列、价格、外饰、内饰、VIN、排量，座位数、轮毂、图片、选择配置
	 */

	/**
	 * 定义一个集合用于存放所有上传图片的uri
	 * 
	 */
	private HashMap<String, String> allImgPaths = new HashMap<String, String>();

	public HashMap<String, String> getAllImgPaths() {
		return allImgPaths;
	}

	/**
	 * 定义一个集合用于存放所有图片的名称
	 */

	private ArrayList<String> allImgNames = new ArrayList<String>();

	public ArrayList<String> getAllImgNames() {
		return allImgNames;
	}

	/**
	 * 定义一个变量用于存放图片上传时保存的状态
	 * 
	 */
	private boolean isImgSave = false;

	public boolean isImgSave() {
		return isImgSave;
	}

	public void setImgSave(boolean isImgSave) {
		this.isImgSave = isImgSave;
	}

	private ArrayList<Car> allDetails = new ArrayList<Car>();

	public void setAllDetails(ArrayList<Car> allDetails) {
		this.allDetails = allDetails;
	}

	public ArrayList<Car> getAllDetails() {
		return allDetails;
	}

	/**
	 * 定义变量用于存放车源发布时的价格
	 */
	private String priceInput;

	public String getPriceInput() {
		return priceInput;
	}

	public void setPriceInput(String priceInput) {
		this.priceInput = priceInput;
	}

	/**
	 * 缓存经销商个人信息
	 */
	private DealerBaseInfo d = null;

	public DealerBaseInfo getD() {
		return d;
	}

	public void setD(DealerBaseInfo d) {
		this.d = d;
	}

	/**
	 * 缓存经销商形象照
	 */
	private Bitmap b;

	public Bitmap getB() {
		return b;
	}

	public void setB(Bitmap b) {
		this.b = b;
	}

	private RecentlyViewedDBHelper mDbHelper;

	public RecentlyViewedDBHelper getmDbHelper() {
		return mDbHelper;
	}

	@Override
	public void onCreate() {
		// TODO Auto-generated method stub
		super.onCreate();
		JPushInterface.setDebugMode(true); // 设置开启日志,发布时请关闭日志
		JPushInterface.init(this);
		System.out.println("app-----init--->");
		mDbHelper = new RecentlyViewedDBHelper(this);

		
	}

	/* 存放省市信息 */
	private String mProvinceInfo;

	public String getmProvinceInfo() {
		return mProvinceInfo;
	}

	public void setmProvinceInfo(String mProvinceInfo) {
		this.mProvinceInfo = mProvinceInfo;
	}

	/* 存放港口信息 */
	private String mPortInfo;

	public String getmPortInfo() {
		return mPortInfo;
	}

	public void setmPortInfo(String mPortInfo) {
		this.mPortInfo = mPortInfo;
	}

	private String mCityInfo;

	public String getmCityInfo() {
		return mCityInfo;
	}

	public void setmCityInfo(String mCityInfo) {
		this.mCityInfo = mCityInfo;
	}

	/* 存放品牌名称的classId */
	private String classId;

	public String getClassId() {
		return classId;
	}

	public void setClassId(String classId) {
		this.classId = classId;
	}

	/* 存放过滤车颜色的值 */

	private String filterColorValue;

	public String getFilterColorValue() {
		return filterColorValue;
	}

	public void setFilterColorValue(String filterColorValue) {
		this.filterColorValue = filterColorValue;
	}

	/* 存放过滤配置的值 */
	private String filterConfigurationValue;

	public String getFilterConfigurationValue() {
		return filterConfigurationValue;
	}

	public void setFilterConfigurationValue(String filterConfigurationValue) {
		this.filterConfigurationValue = filterConfigurationValue;
	}

	/* 存放编辑车源对象 */
	private EditCarInfo mEditCarInfo;

	public EditCarInfo getmEditCarInfo() {
		return mEditCarInfo;
	}

	public void setmEditCarInfo(EditCarInfo mEditCarInfo) {
		this.mEditCarInfo = mEditCarInfo;
	}

	/* 存放车源状态值 */
	private int mCarStateValue = -1;

	public int getmCarStateValue() {
		return mCarStateValue;
	}

	public void setmCarStateValue(int mCarStateValue) {
		this.mCarStateValue = mCarStateValue;
	}

	/* 存放期货的日期 */
	private String mQHDate;

	public String getmQHDate() {
		return mQHDate;
	}

	public void setmQHDate(String mQHDate) {
		this.mQHDate = mQHDate;
	}

	/* 存放编辑期货/现货时的状态 */
	private boolean isEditor;

	public boolean isEditor() {
		return isEditor;
	}

	public void setEditor(boolean isEditor) {
		this.isEditor = isEditor;
	}

	/* 配置选择状态  */
	private boolean  isSelect;

	public boolean isSelect() {
		return isSelect;
	}

	public void setSelect(boolean isSelect) {
		this.isSelect = isSelect;
	}
	
	/*更新配置状态*/
	
	private boolean updateConfigState;

	public boolean isUpdateConfigState() {
		return updateConfigState;
	}

	public void setUpdateConfigState(boolean updateConfigState) {
		this.updateConfigState = updateConfigState;
	}
	/* 保存车架号*/
	
	private String saveVin;

	public String getSaveVin() {
		return saveVin;
	}

	public void setSaveVin(String saveVin) {
		this.saveVin = saveVin;
	}
	
	public boolean isDefault() {
		return isDefault;
	}

	public void setDefault(boolean isDefault) {
		this.isDefault = isDefault;
	}

	/*是否是系统提供的图片 */
	private boolean isDefault=true;
	
	
}
